<?php

class CommentAction extends BaseAction {
	
	public function index() {
		import("ORG.Util.Page");
		$mood_obj = D('mood');
		$count = $mood_obj->count();
		$Page = new Page($count,5);
		$show = $Page->show();


		$mood_list = $mood_obj->order("cTime desc")->limit($Page->firstRow.','.$Page->listRows)->select();
		$this->assign("moods", $mood_list);
		$this->assign('pages',$show);
		$this->display("Index:mood");
	}
	
	public function reply(){
		$pd = $_POST;
		$pd['cTime'] = time();
		$pd['ip']=$_SERVER["HTTP_X_FORWARDED_FOR"];
		if(D("comment")->add($pd)){
			//			$this->success("修改成功！");
		}else{
			//			$this->error("资料无改变或修改失败！");
		}
//		$this->redirect("mood"/*,null, 3, '页面跳转中~'*/);
	}

}
?>